package com.jming.jike.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * @author jinming.zhang
 * @version 0.0.1
 * @date 2022/04/16
 */
@Data
public class BaseDTO {

    @ApiModelProperty(value = "创建人", hidden = true)
    private Long createUser;

    @ApiModelProperty(value = "更新人", hidden = true)
    private Long updateUser;

    @ApiModelProperty(value = "创建时间", hidden = true)
    private Date createTime;

    @ApiModelProperty(value = "更新时间", hidden = true)
    private Date updateTime;

    @ApiModelProperty(value = "当前页")
    private Integer pageIndex;

    @ApiModelProperty(value = "每页记录数(默认10)")
    private Integer pageSize;

    public Integer getPageIndex() {
        return (pageIndex == null || pageIndex <= 0) ? 1 : pageIndex;
    }

    public Integer getPageSize() {
        return (pageSize == null || pageSize <= 0) ? 10 : pageSize;
    }


}
